home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / terms / kermit / b / ckonet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-30  |  1.7 KB  |  66 lines

  1. /* assumes IBM TCP/IP 1.2.1 (or possibly higher) for OS/2 1.x and 2.x */
  2.  
  3. /* to avoid warnings/errors, you will have to fix the TCP/IP headers 
  4.  * in two places: 
  5.  *
  6.  * - in netlib.h, remove the useless SIGALRM definition
  7.  * - in utils.h, replace // comments by regular ones 
  8.  *
  9.  * both headers are not included directly but via types.h
  10.  */
  11.  
  12. #ifdef __IBMC__
  13. #define off_t _dummy_off_t  /* avoid warning */
  14. #include <types.h>
  15. #undef off_t
  16. #else
  17. #define far _far
  18. #define cdecl _cdecl
  19. #include <types.h>
  20. #endif
  21.  
  22. #include <netinet/in.h>
  23. #include <netdb.h>
  24. #include <sys/socket.h>
  25.  
  26. #ifdef TCPDEC
  27. #define IP   244
  28. #define AYT  246
  29. #define socket_close           close_socket
  30. #define socket_ioctl(f,c,b)    ioctl(f,c,(char *)b)
  31. #define bzero(s,n)             memset(s,0,n)
  32. #define bcopy(h,a,l)           memmove(a,h,l)
  33. #define FD_SETSIZE             MAX_SOCKETS
  34. typedef void *caddr_t;
  35. #endif
  36.  
  37. #ifdef TCPIBM
  38. /* uncomment this to use the BSD select() with IBM TCP/IP */
  39. /* #define BSD_SELECT */
  40. #include <sys/ioctl.h>
  41. #include <sys/select.h>
  42. #include <protocol/telnet.h>
  43. #define socket_close           soclose
  44. #define socket_ioctl(f,c,b)    ioctl(f,c,(char *)b,sizeof(long))
  45. /* this is a bit dangerous, but we always read a long with sioctl */
  46. #undef sleep
  47. #undef perror
  48. #endif
  49.  
  50. #define TCPIPLIB
  51.  
  52. #define socket_errno           errno
  53. #define socket_read(f,s,n)     recv(f,s,n,0)
  54. #define socket_write(f,s,n)    send(f,s,n,0)
  55.  
  56. _PROTOTYP( int netinit, (void) );
  57.  
  58. _PROTOTYP( int os2_netopen, (char *, int *, int) );
  59. _PROTOTYP( int os2_netclos, (void) );
  60. _PROTOTYP( int os2_netflui, (void) );
  61. _PROTOTYP( int os2_nettchk, (void) );
  62. _PROTOTYP( int os2_netbreak, (void) );
  63. _PROTOTYP( int os2_netinc, (int) );
  64. _PROTOTYP( int os2_nettol, (char *, int) );
  65. _PROTOTYP( int os2_nettoc, (int) );
  66.